import { books } from "@/model/bd";
import axios from "axios";

export const createBook=()=>{

}
export const delBook = (id)=>{
    let index = books.findIndex(item=>item.id===id)
    console.log(index);
    books.splice(index,1)
    console.log(books);
    
    
}

export const getAll = async ()=>{
    let res =await axios.get(`http://localhost:3000/book`)
    return res.data;
}

export const updateBook = ()=>{
    
}
